package com.qimu.saiyou.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qimu.saiyou.model.dto.joincompete.JoinCompeteRequest;
import com.qimu.saiyou.model.entity.Competition;
import com.qimu.saiyou.model.entity.JoinCompete;
import com.qimu.saiyou.model.entity.User;

/**
* @author: FeiXiang
* @description 针对表【join_compete(参加竞赛)】的数据库操作Service
* @createDate 2024-02-26 15:49:26
*/
public interface JoinCompeteService extends IService<JoinCompete> {

    /**
     * 加入竞争
     *
     * @param joinCompeteRequest 加入竞争添加请求
     * @param loginUser             登录用户
     * @return boolean
     */
    boolean doJoinCompete(JoinCompeteRequest joinCompeteRequest, User loginUser);

    /**
     * 退出竞争
     *
     * @param joinCompeteRequest 加入竞争请求
     * @param loginUser          登录用户
     * @return boolean
     */
    boolean doQuitCompete(JoinCompeteRequest joinCompeteRequest, User loginUser);

    Page<Competition> listMyJoinCompeteByPage( User loginUser);
}
